﻿<%@ Page Title="Item Master Data" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true"
    EnableEventValidation="false" CodeBehind="ItemMasterData.aspx.cs" Inherits="VSM.Business.DataCenter.ItemMasterData" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div>
        <asp:UpdatePanel ID="updatePanel" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <asp:HiddenField ID="hdnCustomerCode" runat="server" />
                <asp:HiddenField ID="hdnID" runat="server" />
                <asp:HiddenField ID="hdnIsUpdate" runat="server" />
                <asp:HiddenField ID="hdnDocEntry" runat="server" />
                <h2>
                    &nbsp;Dealer - Item Master Data</h2>
                <div style="margin-left: 5px; width: 99%;">
                    <hr />
                    <table border="0" width="100%" style="background-color: #D1D4D8;">
                        <tr>
                            <td class="FormLineItemAlt" style="width: 150px">
                                <asp:Label ID="lblCustomerCode" runat="server" Text="Item No." />
                            </td>
                            <td class="FormLineItemAlt" valign="middle" style="width: 250px">
                                <asp:TextBox ID="txtItemCode" runat="server"></asp:TextBox>
                                <asp:Label ID="lblError0" runat="server" Font-Bold="True" ForeColor="Red">*</asp:Label>
                            </td>
                            <td class="FormLineItemAlt" style="width: 110px">
                                <asp:Label ID="lblA" runat="server" Text="Price List:" Width="150px" />
                            </td>
                            <td class="FormLineItemAlt">
                                <asp:DropDownList ID="dllPriceList" runat="server">
                                    <asp:ListItem Value="2">Retail</asp:ListItem>
                                    <asp:ListItem Value="3">MO</asp:ListItem>
                                    <asp:ListItem Value="4">EO</asp:ListItem>
                                </asp:DropDownList>
                                <asp:Label ID="lblErrorA" runat="server" Font-Bold="True" ForeColor="Red">*</asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td class="FormLineItem" valign="top">
                                <asp:Label ID="lblContactPerson" runat="server" Text="Description" />
                            </td>
                            <td class="FormLineItem" valign="top">
                                <asp:TextBox ID="txtItemName" runat="server"></asp:TextBox>
                                <asp:Label ID="lblError1" runat="server" Font-Bold="True" ForeColor="Red">*</asp:Label>
                            </td>
                            <td class="FormLineItem" valign="top">
                                <asp:Label ID="lblB" runat="server" Text="Unit Price:" />
                            </td>
                            <td class="FormLineItem">
                                <asp:TextBox ID="txtUnitPrice" OnKeyPress="return isNumberKey(this, event);" runat="server"
                                    MaxLength="90" Style="text-align: right;">0</asp:TextBox>
                                <asp:Label ID="lblErrorB" runat="server" Font-Bold="True" ForeColor="Red">*</asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td class="FormLineItem" style="border-bottom: dotted 1px #808080; vertical-align: bottom;">
                                Foreign Name:
                            </td>
                            <td class="FormLineItem">
                                <asp:TextBox ID="txtForeignName" runat="server"></asp:TextBox>
                            </td>
                            <td class="FormLineItem" style="border-bottom: dotted 1px #808080; vertical-align: bottom;">
                                WareHouse:
                            </td>
                            <td class="FormLineItem">
                                <asp:DropDownList ID="dllWareHouse" runat="server">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td class="FormLineItem" style="border-bottom: dotted 1px #808080; vertical-align: bottom;">
                                OnHand:
                            </td>
                            <td class="FormLineItem">
                                <asp:TextBox ID="txtOnHand" runat="server" OnKeyPress="return isNumberKey(this, event);"
                                    Style="text-align: right;">0</asp:TextBox>
                                <asp:Label ID="lblError2" runat="server" Font-Bold="True" ForeColor="Red">*</asp:Label>
                            </td>
                            <td class="FormLineItem">
                                &nbsp;
                            </td>
                            <td class="FormLineItem">
                                &nbsp;
                            </td>
                        </tr>
                    </table>
                </div>
                <table width="100%" border="0">
                    <tr>
                        <td>
                            <table style="width: 100%">
                                <tr>
                                    <td style="width: 220px;">
                                        <asp:Button ID="btnUpdate" runat="server" Text="Update" OnClick="btnUpdate_Click"
                                            Style="background-image: url('/Images/bgButton.png'); background-repeat: no-repeat;
                                            color: White;" BorderStyle="Solid" Width="100px" />
                                        <asp:Button ID="btnAddNew" runat="server" BorderStyle="Solid" 
                                            OnClick="btnAddNew_Click" 
                                            Style="background-image: url('/Images/bgButton.png'); background-repeat: no-repeat; color: White;" 
                                            Text="Add New" Width="100px" />
                                    </td>
                                    <td>
                                        <asp:Label ID="lblError" runat="server" Font-Bold="True" ForeColor="Red" Visible="False"></asp:Label>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
                <div style="height: 490px; overflow: scroll">
                    <table style="width: 100%; border: 1px;" cellpadding="3" cellspacing="0">
                        <tr>
                            <td colspan="2" style="text-align: center;">
                                <asp:GridView ID="grdItem" runat="server" CssClass="GridInner" Width="100%" BorderColor="White"
                                    BackColor="White" AllowSorting="True" AutoGenerateColumns="False" CellPadding="2"
                                    AllowPaging="false" HeaderStyle-Height="27px" OnRowDataBound="grdItem_RowDataBound"
                                    OnSelectedIndexChanged="grdItem_SelectedIndexChanged">
                                    <RowStyle BackColor="#D9E0ED" ForeColor="Black" BorderColor="White" BorderWidth="2px"
                                        Height="25px" />
                                    <AlternatingRowStyle BackColor="#EEF1F7" BorderColor="White" BorderWidth="2px" Height="25px" />
                                    <Columns>
                                        <asp:TemplateField>
                                            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="20px" />
                                            <HeaderTemplate>
                                                <asp:CheckBox ID="chkheader" runat="server" onclick="CheckAll(this)" />
                                            </HeaderTemplate>
                                            <ItemTemplate>
                                                <asp:CheckBox ID="chkChild" runat="server" />
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Item Code">
                                            <ItemStyle HorizontalAlign="Center" Width="100px" />
                                            <HeaderStyle VerticalAlign="Middle" />
                                            <ItemTemplate>
                                                <asp:Label ID="lblItemCode" runat="server" Text='<%# Bind("ItemCode") %>' BorderStyle="none">
                                                </asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Item Name">
                                            <ItemStyle HorizontalAlign="Left" Width="300px" />
                                            <HeaderStyle VerticalAlign="Middle" />
                                            <ItemTemplate>
                                                <asp:Label ID="lblItemName" runat="server" Text='<%# Bind("ItemName") %>' BorderStyle="none">
                                                </asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="FrgnName">
                                            <ItemStyle HorizontalAlign="Left" Width="300px" />
                                            <HeaderStyle VerticalAlign="Middle" />
                                            <ItemTemplate>
                                                <asp:Label ID="lblFrgnName" runat="server" Text='<%#Bind("FrgnName")%>' BorderStyle="none">
                                                </asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="ListName">
                                            <ItemStyle HorizontalAlign="Center" Width="100px" />
                                            <HeaderStyle VerticalAlign="Middle" />
                                            <ItemTemplate>
                                                <asp:Label ID="lblPriceList" runat="server" Text='<%#Bind("ListName")%>' BorderStyle="none">
                                                </asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="UnitPrice">
                                            <ItemStyle HorizontalAlign="Right" Width="200px" />
                                            <HeaderStyle VerticalAlign="Middle" />
                                            <ItemTemplate>
                                                <asp:Label ID="lblPrice" runat="server" Text='<%#Bind("Price")%>' BorderStyle="none">
                                                </asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="WareHouse Code">
                                            <ItemStyle HorizontalAlign="Center" Width="150px" />
                                            <HeaderStyle VerticalAlign="Middle" />
                                            <ItemTemplate>
                                                <asp:Label ID="lblWhsName" runat="server" Text='<%#Bind("WhsCode")%>' BorderStyle="none">
                                                </asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="WareHouse Name">
                                            <ItemStyle HorizontalAlign="Left" Width="250px" />
                                            <HeaderStyle VerticalAlign="Middle" />
                                            <ItemTemplate>
                                                <asp:Label ID="lblWhsCode" runat="server" Text='<%#Bind("WhsName")%>' BorderStyle="none">
                                                </asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="OnHand">
                                            <ItemStyle HorizontalAlign="Right" Width="250px" />
                                            <HeaderStyle VerticalAlign="Middle" />
                                            <ItemTemplate>
                                                <asp:Label ID="lblOnHand" runat="server" Text='<%#Bind("OnHand")%>' BorderStyle="none">
                                                </asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                    <PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Center" />
                                    <SelectedRowStyle BackColor="#9471DE" ForeColor="Red" />
                                    <HeaderStyle BackColor="#6095C9" ForeColor="#ffffff" Font-Overline="False" Height="27px"
                                        VerticalAlign="Middle" />
                                    <EmptyDataTemplate>
                                        No Data Found.
                                    </EmptyDataTemplate>
                                </asp:GridView>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" style="text-align: center;">
                            </td>
                        </tr>
                    </table>
                </div>
                <asp:Timer ID="Timer1" runat="server" Interval="1" OnTick="Timer1_Tick" />
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
</asp:Content>
